#include <gtest/gtest.h>
#include "my_string.h" // 导入待测函数所在的头文件

TEST(OperatorPlusTest, BasicAddition) {
    const char* lhs = "Hello";
    String rhs("World");
    String result = lhs + rhs;
    EXPECT_EQ(result.getString(), "HelloWorld");
}

TEST(OperatorPlusTest, EmptyLHS) {
    const char* lhs = "";
    String rhs("World");
    String result = lhs + rhs;
    EXPECT_EQ(result.getString(), "World");
}

TEST(OperatorPlusTest, EmptyRHS) {
    const char* lhs = "Hello";
    String rhs;
    String result = lhs + rhs;
    EXPECT_EQ(result.getString(), "Hello");
}

TEST(OperatorPlusTest, LongLHSAndRHS) {
    const char* lhs = "This is a very long string on the left.";
    String rhs("And this is a very long string on the right.");
    String result = lhs + rhs;
    // 可以根据实际情况添加更多的期望检查
}
